package com.ck.common.constant;

import java.util.Objects;

/**
 * 字典静态值
 * @author ck
 */

public enum DictEnum {
    //文件类型 0:文件夹,1:书签
    HTML_TYPE1("html_type","0", "文件夹"),
    HTML_TYPE2("html_type","1", "书签"),

    //角色类型(1镇街禁毒办 2村社禁毒办 3驻村小组)
    role_type1("role_type","1", "镇街禁毒办"),
    role_type2("role_type","2", "村社禁毒办"),
    role_type3("role_type","3", "驻村小组"),

    //工作职务(1禁毒工作责任人 2禁毒工作人员 3禁毒工作志愿者 4组长 5副组长 6组员)
    WORK_TYPE1("work_type","1","禁毒工作责任人"),
    WORK_TYPE2("work_type","2","禁毒工作人员"),
    WORK_TYPE3("work_type","3","禁毒工作志愿者"),
    WORK_TYPE4("work_type","4","组长"),
    WORK_TYPE5("work_type","5","副组长"),
    WORK_TYPE6("work_type","6","组员"),

    //政治面貌(1党员 2群众)
    POLITIC_TYPE1("politic_type","1","党员"),
    POLITIC_TYPE2("politic_type","2","群众"),

    //1年度任务 2季度任务 3月度任务 4每周任务 5每日任务)
    TASK_TYPE1("task_type","1","年度任务"),
    TASK_TYPE2("task_type","2","季度任务"),
    TASK_TYPE3("task_type","3","月度任务"),
    TASK_TYPE4("task_type","4","每周任务"),
    TASK_TYPE5("task_type","5","每日任务");

    private String filed;
    private String key;
    private String value;

    DictEnum(String filed, String key, String value){
        this.filed = filed;
        this.key = key;
        this.value = value;
    }

    public static String getValue(String filed,String key) {
        for (DictEnum dictEnum : DictEnum.values()) {
            if (Objects.equals(dictEnum.getFiled(), filed) && Objects.equals(dictEnum.getKey(), key)) {
                return dictEnum.getValue();
            }
        }
        return null;
    }


    public String getFiled() {
        return filed;
    }

    public void setFiled(String filed) {
        this.filed = filed;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
